import React, { PureComponent } from 'react'
import {
  TopicWrapper,
  TopicItem
} from '../style'
import { connect } from 'react-redux'
class Topic extends PureComponent {
  render() {
    const { props } = this
    const list = props.topicList.toJS()
    return (
      <TopicWrapper>
        {
          list.map(item => (
            <TopicItem key={item.id}>
              <img className='topic-pic' src={item.imgUrl} alt=''/>
              {item.title}
            </TopicItem>
          ))
        }
        
      </TopicWrapper>
    )
  }
}
const mapStateToProps = state => ({
  topicList: state.getIn(['home', 'topicList'])
})
const mapDispatchToProps = dispatch => ({})
export default connect(mapStateToProps, mapDispatchToProps)(Topic)